# -*- coding: utf-8 -*-
import scrapy


class NewsSpider(scrapy.Spider):
    name = 'news'
    allowed_domains = ['http://news.sina.com.cn/guide/']
    start_urls = ['http://news.sina.com.cn/guide/']

    def parse(self, response):
        list = response.selector.css("div.clearfix")
        for item in list:
            category = item.css("h3.tit02 a::text").extract_first()
            if category != None:
                print(category)
                print("="*100)
                titlelist = item.css("ul.list01 li a::text").extract()
                for t in titlelist:
                    print(t,end=" ")
                print("\n")
